/**
 * 
 */
package dk.dtu.is.model.iec61850;

/**
 * @author dsac
 *
 * Measured Value
 * 
 * Common Data Class
 * Common Data Class Specification for measurand information
 * 
 * 61850-7-3
 *  
 */
public class MeasuredValue {
	private float analogueValue;
	private float[] analogueValues; 
	private boolean isArray = false;

	/**
	 * This function returns a value if and only if the {@value isArray} is false.
	 * 
	 * @return the "AnalogueValue" Data Attribute of this MeasuredValue DataAttribute.
	 * For simplicity, the value returned is a float. 
	 * This means that we treat integer, the "i" value, and float, the "f" value, as only one
	 * main value.
	 */
	public float getAnalogueValue() {
		return analogueValue;
	}

	/**
	 * @param analogueValue the "AnalogueValue" Data Attribute of this MeasuredValue DataAttribute.
	 * For simplicity, the value is a float. 
	 * This means that we treat integer, the "i" value, and float, the "f" value, as only one
	 * main value. 
	 */
	public void setAnalogueValue(float analogueValue) {
		this.analogueValue = analogueValue;
	}
	
	/**
	 * @return the "AnalogueValues" Data Attribute of this MeasuredValue DataAttribute.
	 * This is set if the    
	 */
	public float[] getAnalogueValues() {
		return analogueValues;
	}

	/**
	 * @param analogueValue the "AnalogueValue" Data Attribute of this MeasuredValue DataAttribute.
	 * For simplicity, the value is a float. 
	 * This means that we treat integer, the "i" value, and float, the "f" value, as only one
	 * main value. 
	 */
	public void setAnalogueValues(float[] analogueValues) {
		this.analogueValues = analogueValues;
	}

	/**
	 * Checks if this object contains an array of a simple float.
	 * Default: false
	 * @return true, if is array
	 */
	public boolean isArray() {
		return isArray;
	}
	/**
	 * Sets whether this measured value should be seen as an array or a simple value.
	 * Default: float
	 * 
	 * @param isArray true if this object contains an array of data.
	 */
	public void setArray(boolean isArray) {
		this.isArray = isArray;
	}

}
